<template>
  <div class="screening-container">
    <el-form :model="form" label-width="100px">
    
      <el-form-item label="会议室类型">
        <el-select v-model="form.type" placeholder="请选择类型">
          <el-option label="教室型" value="classroom" />
          <el-option label="圆桌型" value="round_table" />
        </el-select>
      </el-form-item>
      
      <el-form-item label="容量">
        <el-input-number v-model="form.capacity" :min="0" :step="5" />
      </el-form-item>
      
      <el-form-item label="面积(㎡)">
        <el-input-number v-model="form.area" :min="0" :step="5" />
      </el-form-item>
      
      
      <el-form-item label="设备类型">
        <el-select v-model="form.equipments" multiple placeholder="请选择设备">
          <el-option label="投影" value="projector" />
          <el-option label="音响" value="audio" />
          <el-option label="网络" value="network" />
          <el-option label="白板" value="whiteboard" />
        </el-select>
      </el-form-item>
      
      <el-form-item>
        <el-button type="primary" @click="submitForm">筛选</el-button>
        <el-button @click="resetForm">重置</el-button>
      </el-form-item>
    </el-form>
  </div>
</template>

<script setup>
import { ref } from 'vue'

const form = ref({
  name: '',
  type: '',
  capacity: 0,
  area: 0,
  equipments: []
})

const emit = defineEmits(['filter'])

const submitForm = () => {
  emit('filter', form.value)
}

const resetForm = () => {
  form.value = {
    name: '',
    type: '',
    capacity: '',
    area: 0,
    bookingDate: '',
    startHour: '',
    endHour: '',
    equipmentNum: 0
  }
}
</script>

<style scoped>
.screening-container {
  padding: 24px;
  background: white;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

:deep(.el-form-item__label) {
  font-weight: 500;
  color: #1a237e;
}

:deep(.el-input__wrapper) {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  border-radius: 8px;
  transition: all 0.3s ease;
}

:deep(.el-input__wrapper:hover) {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

:deep(.el-input__wrapper.is-focus) {
  box-shadow: 0 0 0 1px #3949ab;
}

:deep(.el-select) {
  width: 100%;
}

:deep(.el-select .el-input__wrapper) {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

:deep(.el-select .el-input__wrapper:hover) {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

:deep(.el-select .el-input__wrapper.is-focus) {
  box-shadow: 0 0 0 1px #3949ab;
}

:deep(.el-input-number) {
  width: 100%;
}

:deep(.el-input-number .el-input__wrapper) {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

:deep(.el-input-number .el-input__wrapper:hover) {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

:deep(.el-input-number .el-input__wrapper.is-focus) {
  box-shadow: 0 0 0 1px #3949ab;
}

:deep(.el-button) {
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 8px;
  transition: all 0.3s ease;
}

:deep(.el-button--primary) {
  background: linear-gradient(90deg, #3949ab 0%, #5c6bc0 100%);
  border: none;
  box-shadow: 0 4px 12px rgba(57, 73, 171, 0.2);
}

:deep(.el-button--primary:hover) {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(57, 73, 171, 0.3);
}

:deep(.el-button--default) {
  background: white;
  border: 1px solid #e0e0e0;
  color: #546e7a;
}

:deep(.el-button--default:hover) {
  background: #f5f5f5;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

:deep(.el-form-item) {
  margin-bottom: 24px;
}

:deep(.el-form-item:last-child) {
  margin-bottom: 0;
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

:deep(.el-select-dropdown__item) {
  padding: 8px 16px;
  transition: all 0.3s ease;
}

:deep(.el-select-dropdown__item.selected) {
  background: linear-gradient(90deg, #3949ab 0%, #5c6bc0 100%);
  color: white;
}

:deep(.el-select-dropdown__item:hover) {
  background-color: rgba(57, 73, 171, 0.1);
}

@media (max-width: 768px) {
  .screening-container {
    padding: 16px;
  }
  
  :deep(.el-form-item:last-child) {
    flex-direction: column;
  }
  
  :deep(.el-button) {
    width: 100%;
  }
}
</style>